package com.sicheng.algorithm.common;

public class Sort {
    public static void swap(int[] arr, int index1, int index2) {
        if (index1 == index2)
            return;
        int temp = arr[index1];
        arr[index1] = arr[index2];
        arr[index2] = temp;
    }

    public static void swap(Integer[] arr, int index1, int index2) {
        if (index1 == index2)
            return;
        int temp = arr[index1];
        arr[index1] = arr[index2];
        arr[index2] = temp;
    }

    public static void swap(char[] arr, int index1, int index2) {
        if (index1 == index2)
            return;
        int temp = arr[index1];
        arr[index1] = arr[index2];
        arr[index2] = (char) temp;
    }

    public static boolean less(Integer num1, Integer num2) {
        return num1 < num2;
    }

}
